import { BaseModel } from '@/uni_modules/stars-UniTS-SQLite-ORM/components/stars-UniTS-SQLite-ORM/dbOrm/model/BaseModel';
import { Table, PrimaryKey, NotNull, FieldType } from '@/uni_modules/stars-UniTS-SQLite-ORM/components/stars-UniTS-SQLite-ORM/dbOrm/annotation/Decorators';
import { FieldTypeEnum } from '@/uni_modules/stars-UniTS-SQLite-ORM/components/stars-UniTS-SQLite-ORM/dbOrm/enum/FieldTypeEnum';

/**
 * 数据源配置表
 */
@Table('app_config')
export class AppConfig extends BaseModel {
	
	// @ts-ignore
	@PrimaryKey()
	// @ts-ignore
	@NotNull()
    // @ts-ignore
	@FieldType({ field: 'id', type: FieldTypeEnum.INTEGER })
	id! : number;

	// @ts-ignore
	@NotNull()
	// @ts-ignore
	@FieldType({ field: 'name', type: FieldTypeEnum.TEXT, length: 255 })
	name! : string;
	
	// @ts-ignore
	@NotNull()
	// @ts-ignore
	@FieldType({ field: 'url', type: FieldTypeEnum.TEXT, length: 255 })
	url! : string;

	// @ts-ignore
	@NotNull()
	// @ts-ignore
	@FieldType({ field: 'code', type: FieldTypeEnum.TEXT, length: 255 })
	code! : string;

	// @ts-ignore
	@NotNull()
	// @ts-ignore
	@FieldType({ field: 'dbName', type: FieldTypeEnum.TEXT, length: 255 })
	dbName! : string;

	// @ts-ignore
	@NotNull()
	// @ts-ignore
	@FieldType({ field: 'dbPath', type: FieldTypeEnum.TEXT , length: 500 })
	dbPath! : string;

	// @ts-ignore
	@FieldType({ field: 'secretLevel', type: FieldTypeEnum.TEXT, length: 255 })
	secretLevel! :string;

	// @ts-ignore
	@FieldType({ field: 'version', type: FieldTypeEnum.TEXT, length: 255 })
	version! :string;
	// @ts-ignore
	@FieldType({ field: 'description', type: FieldTypeEnum.TEXT, length: 255 })
	description! : string;

	// @ts-ignore
	@FieldType({ field: 'createdDate', type: FieldTypeEnum.TEXT, length: 255 })
	createdDate! : Date;
	
	// @ts-ignore
	@FieldType({ field: 'updateDate', type: FieldTypeEnum.TEXT, length: 255 })
	updateDate! : Date;
}